﻿#include "imgui.h"
#include "sdl2_opengl_base.h"

class SDL2OpenGLBase04 : public SDL2OpenGLBase
{
public:
    SDL2OpenGLBase04() {}
    ~SDL2OpenGLBase04() {}

    virtual int init() override
    {
        ImGuiIO& io = ImGui::GetIO(); (void)io;
        return 0;
    }

    virtual int render() override
    {
        ImGui::Begin("Main Window");
        ImGui::Text("This is the main window");

        // 子窗口
        ImGui::Begin("Detached Child Window", nullptr,  ImGuiWindowFlags_NoCollapse);
        ImGui::Text("This is a detached child window");
        ImGui::End();

        ImGui::End();

        return 0;
    }
};

#undef main
int main(int argc, char* argv[])
{
    SDL2OpenGLBase04 app;
    app.run();

    return 0;
}